﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrganizeShow.aspx.cs" Inherits="FPC.Offer.UI.ManagerOrganize.WebForm1" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link href="../H-ui/static/h-ui/css/H-ui.min.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/css/H-ui.admin.css" rel="stylesheet" />
    <link href="../H-ui/Lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/skin/default/skin.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/css/style.css" rel="stylesheet" />
    <link href="../H-ui/Lib/layer/2.4/skin/layer.css" rel="stylesheet" />
    <title>部门管理</title>
</head>
<body>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 部门中心 <span class="c-gray en">&gt;</span> 部门管理<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="../javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="page-container"> 
        <div class="text-c">
            <input type="text" class="input-text" style="width:250px" placeholder="部门名称" id="text1" name="">
            <button type="submit" class="btn btn-success radius" onclick="searchbyname()" name=""><i class="Hui-iconfont">&#xe665;</i> 搜部门</button>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="member_add('添加用户', 'OrganizeAdd.aspx', '', '510')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加部门</a></span></div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-hover table-bg table-sort">
                <thead>
                    <tr class="text-c">
                        <th width="25"><input type="checkbox" onclick="attrchekcbox()" id="checkebox" value=""></th>
                        <th width="80">部门编号</th>
                        <th width="100">部门</th>
                        <th width="100">所属公安局</th>
                        <th width="40">负责人</th>
                        <th width="90">手机</th>
                        <th width="40">邮箱</th>
                        <th width="60">地址</th>
                        <th width="100">操作</th>
                    </tr>
                </thead>
                <tbody id="tbody">
                    
                </tbody>
            </table>
        </div>
    </div>
    <!--_footer 作为公共模版分离出去-->
    <script src="../H-ui/Lib/jquery/1.9.1/jquery.min.js"></script>
    <script src="../H-ui/Lib/layer/2.4/layer.js"></script>
    <script src="../H-ui/static/h-ui/js/H-ui.js"></script>
    <script src="../H-ui/static/h-ui.admin/js/H-ui.admin.js"></script>
    <!--/_footer 作为公共模版分离出去-->
    <!--请在下方写此页面业务相关的脚本-->
    <script src="../H-ui/Lib/My97DatePicker/4.8/WdatePicker.js"></script>
    <script src="../H-ui/Lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
    <script src="../H-ui/Lib/laypage/1.2/laypage.js"></script>
    <script src="../H-ui/Lib/layer/2.4/layer.js"></script>
    <script>
        $(function () {
            ff();

        })      
        function searchbyname()
        {
            ff();
        }
        function ff() {
            $("#tbody").empty();
            $.ajax({
                url: "../GeneralProcessor/MangerOrganize/OrginzeManger.ashx",
                type: "post",
                data: {
                    Actioon: "<%=FPC.Offer.Common.EnumAction.Select %>",
                    name: $("#text1").val()
                },
                success: function (n) {
                    var data = JSON.parse(n);
                    var tr = new Array();
                    $(data).each(function (i, item) {
                        tr.push("<tr class='text-c'>");
                        tr.push("<td><input type='checkbox' value='"+item.id+"' class='b' name=''></td>");
                        tr.push("  <td>" + item.id + "</td>");
                        tr.push(" <td>" + item.deptname + "</td> ");
                        tr.push(" <td>" + item.oname + "</td> ");
                        tr.push(" <td>" + item.user + "</td>");
                        tr.push(" <td>" + item.tel + "</td>");
                        tr.push("<td>" + item.email + "</td>");
                        tr.push(" <td>" + item.addr + "</td>");
                        tr.push(" <td class='td-manage'><a href='OrganizeUpt.aspx?id=" + item.id + "'><i class='Hui-iconfont'>&#xe6df;</i></a> <a title='删除' href='javascript:;' onclick='del(" + item.id + ")' ><i class='Hui-iconfont'>&#xe6e2;</i></a></td>")
                        tr.push("</tr>")
                    })
                    $("#tbody").append(tr.join(""));
                }
            })

        }
        function del(n) {

            $.ajax({
                url: "../GeneralProcessor/MangerOrganize/OrginzeManger.ashx",
                type: "post",
                data: {
                    Actioon: "<%=FPC.Offer.Common.EnumAction.Delete %>",
                    id: n
                },
                success: function (n) {
                    if (n > 0) {
                        layer.alert('删除成功！')
                        location.href = "OrganizeShow.aspx";
                    }
                    else {
                        layer.alert('删除失败！')
                    }
                }
            })
        }
        function attrchekcbox() {
            var n = $("#checkebox").prop("checked");
            $(".b").prop("checked", !n)

        }
        function member_add(title, url, w, h) {

            layer_show(title, url, w, h);
        }
        function member_edit(title, url, w, h) {
            layer_show(title, url, w, h);
        }
    </script>
</body>
</html>
